<template>
  <el-rate v-model="value"
           :colors="colors"
           :low-threshold="1"
           show-score
           score-template="{value}级"
  />
</template>

<script>

import { ref } from 'vue'

export default {
  name: 'input-rate',
  props: ['modelValue'],
  computed: {
    value: {
      get () {
        return this.modelValue
      },
      set (value) {
        this.$emit('update:modelValue', value)
      }
    }
  },
  setup () {
    return {
      colors: ref(['#67C23A', '#E6A23C', '#F56C6C'])
    }
  }
}
</script>

<style scoped>

</style>
